import commonPage from './commonPage'

export default class LoginPage extends commonPage {
  constructor () {
    // 调用父类的构造方法
    super()
    this.userName = 'input[name=username]'
    this.password = 'input[name=password]'
    this.form = 'form'
    this.url = 'http://localhost:7077/login'
  }
  // isTargetPage () {
  //   cy.visit('/login')
  //   cy.url().should('eq', this.url)
  // }
  visitPage () {
    cy.visit('/login')
  }
  loginA (username, pwd) {
    cy.get(this.userName).type(username)
    cy.get(this.password).type(pwd)
    cy.get(this.form).submit()
  }
  isTargetPage () {
    cy.url().should('eq', this.url)
  }
}
